package net.viservice.quartz.listener;

import org.quartz.JobDetail;
import org.quartz.JobKey;
import org.quartz.SchedulerException;
import org.quartz.SchedulerListener;
import org.quartz.Trigger;
import org.quartz.TriggerKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MySchedulerListener implements SchedulerListener {

	private Logger logger = LoggerFactory.getLogger(this.getClass());

	@Override
	public void jobScheduled(Trigger trigger) {
		logger.info("jobScheduled ---> Key:" + trigger.getKey().toString() + ",Description:" + trigger.getDescription());
	}

	@Override
	public void jobUnscheduled(TriggerKey triggerKey) {
		// TODO Auto-generated method stub

	}

	@Override
	public void triggerFinalized(Trigger trigger) {
		// TODO Auto-generated method stub

	}

	@Override
	public void triggerPaused(TriggerKey triggerKey) {
		// TODO Auto-generated method stub

	}

	@Override
	public void triggersPaused(String triggerGroup) {
		// TODO Auto-generated method stub

	}

	@Override
	public void triggerResumed(TriggerKey triggerKey) {
		// TODO Auto-generated method stub

	}

	@Override
	public void triggersResumed(String triggerGroup) {
		// TODO Auto-generated method stub

	}

	@Override
	public void jobAdded(JobDetail jobDetail) {
		logger.info("jobAdded ---> Key:" + jobDetail.getKey().toString() + ",Description:" + jobDetail.getDescription());
	}

	@Override
	public void jobDeleted(JobKey jobKey) {
		logger.info("jobDeleted ---> Key:" + jobKey.toString());
	}
	
	@Override
	public void jobPaused(JobKey jobKey) {
		logger.info("------jobPaused ---> Key:" + jobKey.toString());
	}

	@Override
	public void jobsPaused(String jobGroup) {
		// TODO Auto-generated method stub

	}

	@Override
	public void jobResumed(JobKey jobKey) {
		logger.info("jobResumed ---> Key:" + jobKey.toString());
	}

	@Override
	public void jobsResumed(String jobGroup) {
		// TODO Auto-generated method stub

	}

	@Override
	public void schedulerError(String msg, SchedulerException cause) {
		// TODO Auto-generated method stub

	}

	@Override
	public void schedulerInStandbyMode() {
		// TODO Auto-generated method stub

	}

	@Override
	public void schedulerStarted() {
		logger.info("schedulerStarted ...");
	}

	@Override
	public void schedulerStarting() {
		logger.info("schedulerStarting ...");
	}

	@Override
	public void schedulerShutdown() {
		logger.info("schedulerShutdown ...");
	}

	@Override
	public void schedulerShuttingdown() {
		logger.info("schedulerShuttingdown ...");
	}

	@Override
	public void schedulingDataCleared() {
		// TODO Auto-generated method stub

	}

}
